package gui;

import classes.*;
import interfaces.Services;
import java.awt.CardLayout;
import java.rmi.RemoteException;
import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import utilclasses.ClientUtils;
import utilclasses.Validator;
import utilclasses.simpleDate;

/*
 * @author keaneb1 & egmweb ;D
 */
public class StepsJFrame extends javax.swing.JFrame {
    //set some private variables.
    private List<Car> availableCars;
    private Car selectedCar;
    private Customer tmpCustomer;
    private Card tmpCard;
    private Booking tmpBooking;
    private Invoice tmpInvoice;
    
    /**
     * Creates new form Step2JFrame
     */
    public StepsJFrame() {
        initComponents();
        selectedCar=null;
        tmpCustomer=null;
        tmpCard=null;
        tmpBooking=null;
        tmpInvoice=null;
        nextBtn.setEnabled(false);
        backBtn.setEnabled(false);
        cancelBtn.setEnabled(true);
        finishBtn.setEnabled(false);
        jLabel2.setText("Today's Date: "+simpleDate.getTodaysDate());
        jComboBox2.setEnabled(false);
        toDate.setEnabled(false);
        fromDate.setEnabled(false);
        
        //create the reference to the remote registry RMI object 
        Services stub = ClientUtils.provideRMI();
        if(stub!=null){
            
            //connect to the database and get the locations and categories for the comboboxes
            try {
                jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(stub.getUniqueLocations().toArray()));
                jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(stub.getCategories().toArray()));
            } catch (RemoteException ex) {
                Logger.getLogger(StepsJFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        cancelBtn = new javax.swing.JButton();
        nextBtn = new javax.swing.JButton();
        backBtn = new javax.swing.JButton();
        finishBtn = new javax.swing.JButton();
        mainCard = new javax.swing.JPanel();
        card1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jPanel10 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        fromDate = new datechooser.beans.DateChooserCombo();
        toDate = new datechooser.beans.DateChooserCombo();
        jLabel7 = new javax.swing.JLabel();
        jComboBox2 = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        card2 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jLabel24 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jLabel90 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jPanel6 = new javax.swing.JPanel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        licenseTF = new javax.swing.JTextField();
        licExpDay = new javax.swing.JComboBox();
        licExpMonth = new javax.swing.JComboBox();
        licExpYear = new javax.swing.JComboBox();
        jLabel20 = new javax.swing.JLabel();
        fnameTF = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        lnameTF = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        emailTF = new javax.swing.JTextField();
        newCustomerCheck = new javax.swing.JCheckBox();
        jCheckBox2 = new javax.swing.JCheckBox();
        card3 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        jLabel40 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        jLabel50 = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jLabel55 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        typeOfCard = new javax.swing.JComboBox();
        cardName = new javax.swing.JTextField();
        jLabel44 = new javax.swing.JLabel();
        cardNo = new javax.swing.JTextField();
        jLabel45 = new javax.swing.JLabel();
        expMonth = new javax.swing.JComboBox();
        expYear = new javax.swing.JComboBox();
        jLabel46 = new javax.swing.JLabel();
        csvNo = new javax.swing.JTextField();
        card4 = new javax.swing.JPanel();
        jLabel59 = new javax.swing.JLabel();
        jLabel60 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        jLabel83 = new javax.swing.JLabel();
        jLabel85 = new javax.swing.JLabel();
        jLabel87 = new javax.swing.JLabel();
        jLabel88 = new javax.swing.JLabel();
        jLabel89 = new javax.swing.JLabel();
        jLabel84 = new javax.swing.JLabel();
        jLabel86 = new javax.swing.JLabel();
        jPanel13 = new javax.swing.JPanel();
        jLabel91 = new javax.swing.JLabel();
        jLabel92 = new javax.swing.JLabel();
        jLabel93 = new javax.swing.JLabel();
        jLabel94 = new javax.swing.JLabel();
        jLabel95 = new javax.swing.JLabel();
        jLabel96 = new javax.swing.JLabel();
        jLabel97 = new javax.swing.JLabel();
        jLabel98 = new javax.swing.JLabel();
        jLabel99 = new javax.swing.JLabel();
        jPanel14 = new javax.swing.JPanel();
        jLabel100 = new javax.swing.JLabel();
        jLabel101 = new javax.swing.JLabel();
        jLabel102 = new javax.swing.JLabel();
        jLabel103 = new javax.swing.JLabel();
        jLabel104 = new javax.swing.JLabel();
        jLabel105 = new javax.swing.JLabel();
        jLabel106 = new javax.swing.JLabel();
        jLabel107 = new javax.swing.JLabel();
        jLabel108 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Rent A Car Application Wizard");

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 153, 0));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/login_image.jpg"))); // NOI18N

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel2.setText("jLabel2");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11))
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        cancelBtn.setText("Cancel");
        cancelBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelBtnActionPerformed(evt);
            }
        });

        nextBtn.setText("Next");
        nextBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextBtnActionPerformed(evt);
            }
        });

        backBtn.setText("Back");
        backBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backBtnActionPerformed(evt);
            }
        });

        finishBtn.setText("Submit");
        finishBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                finishBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(backBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(nextBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cancelBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(finishBtn)
                .addContainerGap())
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {backBtn, cancelBtn, finishBtn, nextBtn});

        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cancelBtn)
                    .addComponent(nextBtn)
                    .addComponent(backBtn)
                    .addComponent(finishBtn))
                .addContainerGap())
        );

        mainCard.setLayout(new java.awt.CardLayout());

        card1.setBackground(new java.awt.Color(255, 255, 255));
        card1.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                card1ComponentShown(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Reg No.", "Category", "Location", "Daily Rate"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jTable1MouseReleased(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel3.setText("Step");

        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/Step_1_image.png"))); // NOI18N

        jLabel5.setText("Select Location:");

        jComboBox1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBox1ItemStateChanged(evt);
            }
        });

        jLabel6.setText("Start Date:");

        fromDate.setCurrentView(new datechooser.view.appearance.AppearancesList("Grey",
            new datechooser.view.appearance.ViewAppearance("custom",
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(0, 0, 255),
                    true,
                    true,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 255),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(128, 128, 128),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.LabelPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(0, 0, 255),
                    false,
                    true,
                    new datechooser.view.appearance.swing.LabelPainter()),
                new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                    new java.awt.Color(0, 0, 0),
                    new java.awt.Color(255, 0, 0),
                    false,
                    false,
                    new datechooser.view.appearance.swing.ButtonPainter()),
                (datechooser.view.BackRenderer)null,
                false,
                true)));
    fromDate.setWeekStyle(datechooser.view.WeekDaysStyle.SHORT);
    try {
        fromDate.setDefaultPeriods(new datechooser.model.multiple.PeriodSet());
    } catch (datechooser.model.exeptions.IncompatibleDataExeption e1) {
        e1.printStackTrace();
    }
    fromDate.addSelectionChangedListener(new datechooser.events.SelectionChangedListener() {
        public void onSelectionChange(datechooser.events.SelectionChangedEvent evt) {
            fromDateOnSelectionChange(evt);
        }
    });

    toDate.setCurrentView(new datechooser.view.appearance.AppearancesList("Grey",
        new datechooser.view.appearance.ViewAppearance("custom",
            new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                new java.awt.Color(0, 0, 0),
                new java.awt.Color(0, 0, 255),
                false,
                true,
                new datechooser.view.appearance.swing.ButtonPainter()),
            new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                new java.awt.Color(0, 0, 0),
                new java.awt.Color(0, 0, 255),
                true,
                true,
                new datechooser.view.appearance.swing.ButtonPainter()),
            new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                new java.awt.Color(0, 0, 255),
                new java.awt.Color(0, 0, 255),
                false,
                true,
                new datechooser.view.appearance.swing.ButtonPainter()),
            new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                new java.awt.Color(128, 128, 128),
                new java.awt.Color(0, 0, 255),
                false,
                true,
                new datechooser.view.appearance.swing.LabelPainter()),
            new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                new java.awt.Color(0, 0, 0),
                new java.awt.Color(0, 0, 255),
                false,
                true,
                new datechooser.view.appearance.swing.LabelPainter()),
            new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
                new java.awt.Color(0, 0, 0),
                new java.awt.Color(255, 0, 0),
                false,
                false,
                new datechooser.view.appearance.swing.ButtonPainter()),
            (datechooser.view.BackRenderer)null,
            false,
            true)));
try {
    toDate.setDefaultPeriods(new datechooser.model.multiple.PeriodSet());
    } catch (datechooser.model.exeptions.IncompatibleDataExeption e1) {
        e1.printStackTrace();
    }
    toDate.addSelectionChangedListener(new datechooser.events.SelectionChangedListener() {
        public void onSelectionChange(datechooser.events.SelectionChangedEvent evt) {
            toDateOnSelectionChange(evt);
        }
    });

    jLabel7.setText("End Date:");

    jComboBox2.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            jComboBox2ItemStateChanged(evt);
        }
    });

    jLabel8.setText("Car Class:");

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(
        jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel10Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel5))
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel10Layout.createSequentialGroup()
                    .addGap(28, 28, 28)
                    .addComponent(fromDate, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel10Layout.createSequentialGroup()
                    .addGap(78, 78, 78)
                    .addComponent(jLabel6)))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                    .addComponent(toDate, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(32, 32, 32))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                    .addComponent(jLabel7)
                    .addGap(138, 138, 138)))
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                    .addComponent(jLabel8)
                    .addGap(41, 41, 41)))
            .addContainerGap())
    );

    jPanel10Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {fromDate, toDate});

    jPanel10Layout.setVerticalGroup(
        jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel5)
                .addComponent(jLabel6)
                .addComponent(jLabel7)
                .addComponent(jLabel8))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(fromDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(toDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addContainerGap())
    );

    javax.swing.GroupLayout card1Layout = new javax.swing.GroupLayout(card1);
    card1.setLayout(card1Layout);
    card1Layout.setHorizontalGroup(
        card1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card1Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(card1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, card1Layout.createSequentialGroup()
                    .addGap(0, 296, Short.MAX_VALUE)
                    .addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel4))
                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 763, Short.MAX_VALUE))
            .addContainerGap())
    );
    card1Layout.setVerticalGroup(
        card1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card1Layout.createSequentialGroup()
            .addGroup(card1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
            .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap())
    );

    mainCard.add(card1, "card2");

    card2.setBackground(new java.awt.Color(255, 255, 255));
    card2.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            card2ComponentShown(evt);
        }
    });

    jLabel9.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel9.setText("Step");

    jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/Step_2_image.png"))); // NOI18N

    jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel3.setToolTipText("");

    jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel11.setText("Step 1 Complete");

    jLabel12.setText("Location:");

    jLabel13.setForeground(new java.awt.Color(0, 0, 255));
    jLabel13.setText("jLabel13");

    jLabel14.setText("Duration:");

    jLabel15.setForeground(new java.awt.Color(0, 0, 255));
    jLabel15.setText("jLabel15");

    jLabel16.setText("Car Class:");

    jLabel17.setForeground(new java.awt.Color(0, 0, 255));
    jLabel17.setText("jLabel17");

    jLabel18.setText("Registration");

    jLabel19.setForeground(new java.awt.Color(0, 0, 255));
    jLabel19.setText("jLabel19");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel3Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addComponent(jLabel12)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel13)
                    .addGap(87, 87, 87)
                    .addComponent(jLabel14)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel15)
                    .addGap(87, 87, 87)
                    .addComponent(jLabel16)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel17)
                    .addGap(82, 82, 82)
                    .addComponent(jLabel18)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel19))
                .addComponent(jLabel11))
            .addContainerGap(113, Short.MAX_VALUE))
    );
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel3Layout.createSequentialGroup()
            .addGap(5, 5, 5)
            .addComponent(jLabel11)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel12)
                .addComponent(jLabel13)
                .addComponent(jLabel14)
                .addComponent(jLabel15)
                .addComponent(jLabel16)
                .addComponent(jLabel17)
                .addComponent(jLabel18)
                .addComponent(jLabel19))
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel24.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel24.setText("Existing Customer Details");

    jTable2.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            "Credit Card No", "Name"
        }
    ) {
        boolean[] canEdit = new boolean [] {
            false, false
        };

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit [columnIndex];
        }
    });
    jTable2.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            jTable2MouseReleased(evt);
        }
    });
    jScrollPane2.setViewportView(jTable2);

    jLabel90.setText("Search by Credit Card No :");

    jTextField9.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            jTextField9KeyReleased(evt);
        }
    });

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        .addGroup(jPanel5Layout.createSequentialGroup()
            .addGap(107, 107, 107)
            .addComponent(jLabel24)
            .addContainerGap(119, Short.MAX_VALUE))
        .addGroup(jPanel5Layout.createSequentialGroup()
            .addComponent(jLabel90)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(0, 75, Short.MAX_VALUE))
    );
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel5Layout.createSequentialGroup()
            .addComponent(jLabel24)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel90)
                .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
    );

    jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel25.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel25.setText("New Customer Details");

    jLabel26.setText("License No:");

    jLabel28.setText("Expiry Date:");

    licenseTF.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            licenseTFKeyReleased(evt);
        }
    });

    licExpDay.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10" }));
    licExpDay.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            licExpDayMouseClicked(evt);
        }
    });

    licExpMonth.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10" }));

    licExpYear.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "----", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020" }));
    licExpYear.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            licExpYearItemStateChanged(evt);
        }
    });

    jLabel20.setText("First Name:");

    jLabel21.setText("Last Name:");

    lnameTF.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            lnameTFKeyReleased(evt);
        }
    });

    jLabel23.setText("Email:");

    emailTF.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            emailTFKeyReleased(evt);
        }
    });

    newCustomerCheck.setText("Click to add new customer");
    newCustomerCheck.setName("enabler"); // NOI18N
    newCustomerCheck.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            newCustomerCheckActionPerformed(evt);
        }
    });

    jCheckBox2.setText("Customer is over 25");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel6Layout.createSequentialGroup()
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addGap(10, 10, 10)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel26, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel23, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel21, javax.swing.GroupLayout.Alignment.LEADING)))
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addGap(91, 91, 91)
                    .addComponent(jLabel25))
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addGap(8, 8, 8)
                    .addComponent(newCustomerCheck))
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addGap(10, 10, 10)
                    .addComponent(jLabel28)
                    .addGap(37, 37, 37)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(lnameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel6Layout.createSequentialGroup()
                            .addComponent(licExpDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(6, 6, 6)
                            .addComponent(licExpMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(6, 6, 6)
                            .addComponent(licExpYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(emailTF, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(licenseTF, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(fnameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jCheckBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addContainerGap(124, Short.MAX_VALUE))
    );

    jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {emailTF, fnameTF, licenseTF, lnameTF});

    jPanel6Layout.setVerticalGroup(
        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel6Layout.createSequentialGroup()
            .addComponent(jLabel25)
            .addGap(14, 14, 14)
            .addComponent(newCustomerCheck)
            .addGap(9, 9, 9)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(fnameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel20))
            .addGap(6, 6, 6)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel21)
                .addComponent(lnameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGap(6, 6, 6)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel23)
                .addComponent(emailTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGap(6, 6, 6)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel26)
                .addComponent(licenseTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addGap(3, 3, 3)
                    .addComponent(jLabel28))
                .addComponent(licExpDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(licExpMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(licExpYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jCheckBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap(23, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout card2Layout = new javax.swing.GroupLayout(card2);
    card2.setLayout(card2Layout);
    card2Layout.setHorizontalGroup(
        card2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card2Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(card2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(card2Layout.createSequentialGroup()
                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(card2Layout.createSequentialGroup()
                    .addComponent(jLabel9)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel10)))
            .addContainerGap())
    );
    card2Layout.setVerticalGroup(
        card2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card2Layout.createSequentialGroup()
            .addGroup(card2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGap(9, 9, 9)
            .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(card2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addContainerGap())
    );

    mainCard.add(card2, "card3");

    card3.setBackground(new java.awt.Color(255, 255, 255));
    card3.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            card3ComponentShown(evt);
        }
    });

    jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel7.setToolTipText("");

    jLabel29.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel29.setText("Step 1 Complete");

    jLabel30.setText("Location:");

    jLabel31.setForeground(new java.awt.Color(0, 0, 255));
    jLabel31.setText("jLabel13");

    jLabel32.setText("Duration:");

    jLabel33.setForeground(new java.awt.Color(0, 0, 255));
    jLabel33.setText("jLabel15");

    jLabel34.setText("Car Class:");

    jLabel35.setForeground(new java.awt.Color(0, 0, 255));
    jLabel35.setText("jLabel17");

    jLabel36.setText("Registration");

    jLabel37.setForeground(new java.awt.Color(0, 0, 255));
    jLabel37.setText("jLabel19");

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(
        jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel7Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel7Layout.createSequentialGroup()
                    .addComponent(jLabel30)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel31)
                    .addGap(87, 87, 87)
                    .addComponent(jLabel32)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel33)
                    .addGap(87, 87, 87)
                    .addComponent(jLabel34)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel35)
                    .addGap(82, 82, 82)
                    .addComponent(jLabel36)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel37))
                .addComponent(jLabel29))
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    jPanel7Layout.setVerticalGroup(
        jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel7Layout.createSequentialGroup()
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jLabel29)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel30)
                .addComponent(jLabel31)
                .addComponent(jLabel32)
                .addComponent(jLabel33)
                .addComponent(jLabel34)
                .addComponent(jLabel35)
                .addComponent(jLabel36)
                .addComponent(jLabel37))
            .addContainerGap())
    );

    jLabel38.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel38.setText("Step");

    jLabel39.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/Step_3_image.png"))); // NOI18N

    jPanel8.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel40.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel40.setText("Step 2 Complete");

    jLabel47.setText("Name:");

    jLabel48.setText("Email:");

    jLabel50.setForeground(new java.awt.Color(0, 0, 255));
    jLabel50.setText("jLabel50");

    jLabel51.setForeground(new java.awt.Color(0, 0, 255));
    jLabel51.setText("jLabel51");

    jLabel53.setText("License No:");

    jLabel55.setText("Expiry Date:");

    jLabel56.setForeground(new java.awt.Color(0, 0, 255));
    jLabel56.setText("jLabel56");

    jLabel58.setForeground(new java.awt.Color(0, 0, 255));
    jLabel58.setText("jLabel58");

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(
        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel8Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel8Layout.createSequentialGroup()
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel47)
                        .addComponent(jLabel48))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jLabel51, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                        .addComponent(jLabel50, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(60, 60, 60)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel55)
                        .addComponent(jLabel53))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel56, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel58, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addComponent(jLabel40))
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    jPanel8Layout.setVerticalGroup(
        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel8Layout.createSequentialGroup()
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jLabel40)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel47)
                .addComponent(jLabel50)
                .addComponent(jLabel53)
                .addComponent(jLabel56))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel48)
                .addComponent(jLabel51)
                .addComponent(jLabel55)
                .addComponent(jLabel58))
            .addContainerGap())
    );

    jPanel9.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel41.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel41.setText("Payment Details");

    jLabel42.setText("Card Type:");

    jLabel43.setText("Name on Card:");

    typeOfCard.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-----", "AMEX", "LASER", "MAESTRO", "MASTERCARD", "VISA" }));

    jLabel44.setText("Card Number:");

    jLabel45.setText("Expiry Date:");

    expMonth.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));

    expYear.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-----", "2012", "2013", "2014", "2015" }));
    expYear.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            expYearMouseClicked(evt);
        }
    });

    jLabel46.setText("CSV Number:");

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(
        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel9Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel9Layout.createSequentialGroup()
                    .addComponent(jLabel42)
                    .addGap(35, 35, 35)
                    .addComponent(typeOfCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(85, 85, 85)
                    .addComponent(jLabel44)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(cardNo, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel46)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(csvNo, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(49, 49, 49))
                .addGroup(jPanel9Layout.createSequentialGroup()
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel9Layout.createSequentialGroup()
                            .addComponent(jLabel43)
                            .addGap(18, 18, 18)
                            .addComponent(cardName, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel45)
                            .addGap(18, 18, 18)
                            .addComponent(expMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(expYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLabel41))
                    .addContainerGap())))
    );
    jPanel9Layout.setVerticalGroup(
        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jLabel41)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel42)
                .addComponent(typeOfCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel44)
                .addComponent(cardNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel46)
                .addComponent(csvNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGap(18, 18, 18)
            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel43)
                .addComponent(cardName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel45)
                .addComponent(expMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(expYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addContainerGap())
    );

    javax.swing.GroupLayout card3Layout = new javax.swing.GroupLayout(card3);
    card3.setLayout(card3Layout);
    card3Layout.setHorizontalGroup(
        card3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card3Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(card3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(card3Layout.createSequentialGroup()
                    .addGap(298, 298, 298)
                    .addComponent(jLabel38)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel39, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addContainerGap())
    );
    card3Layout.setVerticalGroup(
        card3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card3Layout.createSequentialGroup()
            .addGroup(card3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel39, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap())
    );

    mainCard.add(card3, "card4");

    card4.setBackground(new java.awt.Color(255, 255, 255));
    card4.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            card4ComponentShown(evt);
        }
    });

    jLabel59.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel59.setText("Step");

    jLabel60.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/Step_4_image.png"))); // NOI18N

    jPanel12.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel83.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel83.setText("Step 3 Complete");

    jLabel85.setText("Name on Card:");

    jLabel87.setForeground(new java.awt.Color(0, 0, 255));
    jLabel87.setText("jLabel87");

    jLabel88.setText("Card Number:");

    jLabel89.setForeground(new java.awt.Color(0, 0, 255));
    jLabel89.setText("jLabel89");

    jLabel84.setText("Payment Type:");

    jLabel86.setForeground(new java.awt.Color(0, 0, 255));
    jLabel86.setText("jLabel86");

    javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
    jPanel12.setLayout(jPanel12Layout);
    jPanel12Layout.setHorizontalGroup(
        jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel12Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel12Layout.createSequentialGroup()
                    .addComponent(jLabel85)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jLabel87, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel88)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel89, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel84)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel86, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addComponent(jLabel83))
            .addContainerGap(187, Short.MAX_VALUE))
    );
    jPanel12Layout.setVerticalGroup(
        jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel12Layout.createSequentialGroup()
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jLabel83)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel85)
                .addComponent(jLabel87)
                .addComponent(jLabel88)
                .addComponent(jLabel89)
                .addComponent(jLabel84)
                .addComponent(jLabel86))
            .addContainerGap())
    );

    jPanel13.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel13.setToolTipText("");

    jLabel91.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel91.setText("Step 1 Complete");

    jLabel92.setText("Location:");

    jLabel93.setForeground(new java.awt.Color(0, 0, 255));
    jLabel93.setText("jLabel13");

    jLabel94.setText("Duration:");

    jLabel95.setForeground(new java.awt.Color(0, 0, 255));
    jLabel95.setText("jLabel15");

    jLabel96.setText("Car Class:");

    jLabel97.setForeground(new java.awt.Color(0, 0, 255));
    jLabel97.setText("jLabel17");

    jLabel98.setText("Registration");

    jLabel99.setForeground(new java.awt.Color(0, 0, 255));
    jLabel99.setText("jLabel19");

    javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
    jPanel13.setLayout(jPanel13Layout);
    jPanel13Layout.setHorizontalGroup(
        jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel13Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel13Layout.createSequentialGroup()
                    .addComponent(jLabel92)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel93)
                    .addGap(87, 87, 87)
                    .addComponent(jLabel94)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel95)
                    .addGap(87, 87, 87)
                    .addComponent(jLabel96)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel97)
                    .addGap(82, 82, 82)
                    .addComponent(jLabel98)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel99))
                .addComponent(jLabel91))
            .addContainerGap(113, Short.MAX_VALUE))
    );
    jPanel13Layout.setVerticalGroup(
        jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel13Layout.createSequentialGroup()
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jLabel91)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel92)
                .addComponent(jLabel93)
                .addComponent(jLabel94)
                .addComponent(jLabel95)
                .addComponent(jLabel96)
                .addComponent(jLabel97)
                .addComponent(jLabel98)
                .addComponent(jLabel99))
            .addContainerGap())
    );

    jPanel14.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel100.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jLabel100.setText("Step 2 Complete");

    jLabel101.setText("Name:");

    jLabel102.setText("Email:");

    jLabel103.setForeground(new java.awt.Color(0, 0, 255));
    jLabel103.setText("jLabel103");

    jLabel104.setForeground(new java.awt.Color(0, 0, 255));
    jLabel104.setText("jLabel104");

    jLabel105.setText("License No:");

    jLabel106.setText("Expiry Date:");

    jLabel107.setForeground(new java.awt.Color(0, 0, 255));
    jLabel107.setText("jLabel107");

    jLabel108.setForeground(new java.awt.Color(0, 0, 255));
    jLabel108.setText("jLabel108");

    javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
    jPanel14.setLayout(jPanel14Layout);
    jPanel14Layout.setHorizontalGroup(
        jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel14Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel14Layout.createSequentialGroup()
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel101)
                        .addComponent(jLabel102))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jLabel104, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                        .addComponent(jLabel103, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(60, 60, 60)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel106)
                        .addComponent(jLabel105))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel107, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel108, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addComponent(jLabel100))
            .addContainerGap(313, Short.MAX_VALUE))
    );
    jPanel14Layout.setVerticalGroup(
        jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel14Layout.createSequentialGroup()
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jLabel100)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel101)
                .addComponent(jLabel103)
                .addComponent(jLabel105)
                .addComponent(jLabel107))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel102)
                .addComponent(jLabel104)
                .addComponent(jLabel106)
                .addComponent(jLabel108))
            .addContainerGap())
    );

    jLabel22.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    jLabel22.setText("Total due:");

    jLabel27.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
    jLabel27.setText("jLabel27");

    javax.swing.GroupLayout card4Layout = new javax.swing.GroupLayout(card4);
    card4.setLayout(card4Layout);
    card4Layout.setHorizontalGroup(
        card4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card4Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(card4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, card4Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addGroup(card4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, card4Layout.createSequentialGroup()
                            .addComponent(jLabel59, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel60))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, card4Layout.createSequentialGroup()
                            .addComponent(jLabel22)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)))))
            .addContainerGap())
    );
    card4Layout.setVerticalGroup(
        card4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(card4Layout.createSequentialGroup()
            .addGroup(card4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addComponent(jLabel59, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel60, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(26, 26, 26)
            .addGroup(card4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel27)
                .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addContainerGap(34, Short.MAX_VALUE))
    );

    mainCard.add(card4, "card5");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(mainCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGroup(jPanel1Layout.createSequentialGroup()
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addContainerGap())
    );
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel1Layout.createSequentialGroup()
            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(mainCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap())
    );

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );

    pack();
    }// </editor-fold>//GEN-END:initComponents
    private void nextBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextBtnActionPerformed
        //logic to do when the next button is clicked
        CardLayout cl = (CardLayout)mainCard.getLayout();
        
        if (card1.isVisible()) {
            //get the selected dates and do some validation
            Long startDate = toDate.getSelectedDate().getTimeInMillis();
            Long rightNow = System.currentTimeMillis();
            Long endDate = fromDate.getSelectedDate().getTimeInMillis();
            if (startDate < endDate) {
                JOptionPane.showMessageDialog(null, "Error: You cannot have the End Date before the Start Date!!");
            }else if((startDate < rightNow) || (endDate < rightNow)){
                JOptionPane.showMessageDialog(null, "Error: You cannot select a Date in the past!!");
            }else cl.next(mainCard);  
        }
        else if(card2.isVisible()){
            //if the checkbox for new customer is selected, get the details and create a tmp customer object
            if(newCustomerCheck.isSelected()){
                String dateString = licExpYear.getSelectedItem().toString()+"-"+licExpMonth.getSelectedItem().toString()+"-"+licExpDay.getSelectedItem().toString();
                Date newDate = Date.valueOf(dateString);
                tmpCustomer = new Customer(fnameTF.getText().toUpperCase(),lnameTF.getText().toUpperCase(),emailTF.getText(),licenseTF.getText(),newDate);
                cl.next(mainCard);
            }
            else cl.next(mainCard);
            
        }else if(card3.isVisible()){
            if(newCustomerCheck.isSelected()){
                //if the new customer was selected, get the credit card details and create a new card object
                String expiryDate = expMonth.getSelectedItem().toString()+expYear.getSelectedItem().toString();
                tmpCard = new Card(cardNo.getText(),cardName.getText(),typeOfCard.getSelectedItem().toString(),expiryDate,Integer.parseInt(csvNo.getText()));
                tmpCustomer.setCreditCard(tmpCard);
                
                Services stub = ClientUtils.provideRMI();
                if(stub!=null){
                    try {
                        stub.insertNewCard(tmpCard);
                        stub.insertNewCustomer(tmpCustomer);
                    } catch (RemoteException ex) {
                    Logger.getLogger(StepsJFrame.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    cl.next(mainCard);
                }
            }
            else cl.next(mainCard);
        }else if (!card4.isVisible()) {
            cl.next(mainCard);
        }
    }//GEN-LAST:event_nextBtnActionPerformed
    private void backBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBtnActionPerformed
        CardLayout cl = (CardLayout)mainCard.getLayout();
        if (!card1.isVisible()) {
            cl.previous(mainCard);
        }
    }//GEN-LAST:event_backBtnActionPerformed
    private void jTable1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseReleased
        //when a row in the car table is selected, get the selected line items
        DefaultTableModel carTBLModel= (DefaultTableModel)jTable1.getModel();
        int carSelection = jTable1.getSelectedRow();
        String regno = carTBLModel.getValueAt(carSelection, 0).toString();
        String category = carTBLModel.getValueAt(carSelection, 1).toString();
        String location = carTBLModel.getValueAt(carSelection, 2).toString();
        daily_rate = Double.parseDouble(carTBLModel.getValueAt(carSelection, 3).toString());
        
        //format the dates from the date chooser for entry in the SQL database and get the date values
        DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
	toDate.setDateFormat(formater);
        fromDate.setDateFormat(formater);
        Date startDate = Date.valueOf(fromDate.getText());
        Date endDate = Date.valueOf(toDate.getText());
        
        //create tmp object to store the data
        Category newCategory = new Category(category,daily_rate);
        selectedCar =  new Car(regno,newCategory,location);
        tmpBooking = new Booking(selectedCar,startDate,endDate);
        
        //enable the next button
        nextBtn.setEnabled(true);

        
    }//GEN-LAST:event_jTable1MouseReleased
    private void card2ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_card2ComponentShown
        //when card2 is shown, set component default settings
        nextBtn.setEnabled(false);
        backBtn.setEnabled(true);
        cancelBtn.setEnabled(true);
        finishBtn.setEnabled(false);
        newCustomerCheck.setSelected(false);
        
        //fill in the details of the selection from the previous card
        jLabel13.setText(selectedCar.getLocation());
        ClientUtils.setAppearance(jPanel6, false);
        jLabel15.setText(String.valueOf((toDate.getSelectedDate().getTimeInMillis()-fromDate.getSelectedDate().getTimeInMillis())/86400000)+" Days");
        jLabel16.setText(selectedCar.getLocation());
        jLabel17.setText(selectedCar.getCategory().getCategory());
        jLabel19.setText(selectedCar.getReg_no());
        
        //fill the customer table from the database
        DefaultTableModel customerTBLModel = (DefaultTableModel)jTable2.getModel();
        customerTBLModel = ClientUtils.fillCustomers(customerTBLModel,"");  
    }//GEN-LAST:event_card2ComponentShown
    private void cancelBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBtnActionPerformed
        //logic for the cancel button, go back to the start card
        card1.setVisible(true);
        
        //clear the selections from card1
        DefaultTableModel carTBLModel= (DefaultTableModel)jTable1.getModel();
        while(carTBLModel.getRowCount()>0){
            carTBLModel.removeRow(0);
        }
        
        jComboBox1.setSelectedIndex(0);
        toDate.setSelectedDate(null);
        fromDate.setSelectedDate(null);
        fromDate.setEnabled(false);      
        toDate.setEnabled(false);
        try{
            jComboBox2.setSelectedIndex(0);
        }catch(Exception ex){
            jComboBox2.setEnabled(false);
        }
    }//GEN-LAST:event_cancelBtnActionPerformed
    private void newCustomerCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newCustomerCheckActionPerformed
        //enable the next button only if customer checkbox and license year are selected
        if (newCustomerCheck.isSelected() && licExpYear.getSelectedIndex()!=0){
            nextBtn.setEnabled(true);
        }else if(!newCustomerCheck.isSelected()){
            nextBtn.setEnabled(false);
        }
        
        if (newCustomerCheck.isSelected()){
        // disable cc fields on card4
            typeOfCard.setSelectedIndex(0);
            cardNo.setText("");
            csvNo.setText("");
            cardName.setText("");
            expMonth.setSelectedIndex(0);
            expYear.setSelectedIndex(0);
        }
        //code to disable the new customer panel or existing customer panel or enable them
        boolean enablep5=true;
        boolean enablep6=false;
        DefaultTableModel customerTBLModel = (DefaultTableModel)jTable2.getModel();
        if(newCustomerCheck.isSelected()){
            enablep5=false;
            enablep6=true;
            //use a method in clientutils to set the appearance based on the boolean values.
            ClientUtils.setAppearance(jPanel5, enablep5);
            ClientUtils.setAppearance(jPanel6, enablep6);
            while(customerTBLModel.getRowCount()>0){
                customerTBLModel.removeRow(0);
            }
       }
       if(!newCustomerCheck.isSelected()){
            ClientUtils.setAppearance(jPanel5, enablep5);
            ClientUtils.setAppearance(jPanel6, enablep6);
            customerTBLModel = ClientUtils.fillCustomers(customerTBLModel,"");
        }
    }//GEN-LAST:event_newCustomerCheckActionPerformed
    private void card1ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_card1ComponentShown
        //set components when card1 is shown
        nextBtn.setEnabled(false);
        backBtn.setEnabled(false);
        cancelBtn.setEnabled(true);
        finishBtn.setEnabled(false);
    }//GEN-LAST:event_card1ComponentShown
    private void card3ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_card3ComponentShown
        //enable the next button if the expiry month index is not 0
        if(expMonth.getSelectedIndex()!=0){
            nextBtn.setEnabled(true);
        }else{
            nextBtn.setEnabled(false);
        }
        
        //set the enabled value of the buttons and fill in the labels with selection from previous cards.
        backBtn.setEnabled(true);
        cancelBtn.setEnabled(true);
        finishBtn.setEnabled(false);
        jLabel31.setText(selectedCar.getLocation());
        jLabel33.setText(String.valueOf(ClientUtils.getNrOfDaysFromDateInterval(tmpBooking.getStartDate(),tmpBooking.getReturnDate()))+" days");
        jLabel35.setText(selectedCar.getCategory().getCategory());
        jLabel37.setText(selectedCar.getReg_no());
        jLabel50.setText(tmpCustomer.getFirstName()+" "+tmpCustomer.getLastName());
        jLabel51.setText(tmpCustomer.getEmail());
        jLabel56.setText(tmpCustomer.getLicenseNo());
        jLabel58.setText(tmpCustomer.getLicenseExpire().toString());
        
        //if an exising customer was selected in the last screen, fill in the credit card details
        if(tmpCustomer.getCreditCard()!=null){
            cardNo.setText(tmpCustomer.getCreditCard().getCardNumber());
            csvNo.setText(Integer.toString(tmpCustomer.getCreditCard().getCsvNumber()));
            cardName.setText(tmpCustomer.getFirstName()+" "+tmpCustomer.getLastName());
            typeOfCard.setSelectedItem(tmpCustomer.getCreditCard().getCardType());
            expMonth.setSelectedItem(tmpCustomer.getCreditCard().getExpirationDate().subSequence(0,2).toString());
            expYear.setSelectedItem(tmpCustomer.getCreditCard().getExpirationDate().subSequence(2,6).toString());
            nextBtn.setEnabled(true);
        }              
    }//GEN-LAST:event_card3ComponentShown
    private void card4ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_card4ComponentShown
        //set the enable status of the button when the card is shown
        nextBtn.setEnabled(false);
        backBtn.setEnabled(true);
        cancelBtn.setEnabled(true);
        finishBtn.setEnabled(true);
        
        //fill in the labels with the selections from the previous card
        jLabel93.setText(tmpBooking.getCar().getLocation());
        jLabel95.setText(String.valueOf(ClientUtils.getNrOfDaysFromDateInterval(tmpBooking.getStartDate(),tmpBooking.getReturnDate()))+" Days");
        jLabel97.setText(selectedCar.getCategory().getCategory());
        jLabel99.setText(selectedCar.getReg_no());
        
        jLabel103.setText(tmpCustomer.getFirstName()+" "+tmpCustomer.getLastName());
        jLabel104.setText(tmpCustomer.getEmail());
        jLabel107.setText(tmpCustomer.getLicenseNo());
        jLabel108.setText(tmpCustomer.getLicenseExpire().toString());
        
        jLabel87.setText(tmpCustomer.getCreditCard().getPersonName());
        jLabel89.setText(tmpCustomer.getCreditCard().getCardNumber().toString());
        jLabel86.setText(tmpCustomer.getCreditCard().getCardType());
        total = Double.parseDouble(String.valueOf(ClientUtils.getNrOfDaysFromDateInterval(tmpBooking.getStartDate(),tmpBooking.getReturnDate())))*daily_rate;
        jLabel27.setText("€ "+total);
        
    }//GEN-LAST:event_card4ComponentShown
    private void jTextField9KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField9KeyReleased
        //if the user enters something in the search field, use that to narrow the list of customers.
        DefaultTableModel customerTBLModel = (DefaultTableModel)jTable2.getModel();
        String search = jTextField9.getText();
        System.out.print(search);
        customerTBLModel = ClientUtils.fillCustomers(customerTBLModel,search);
        
        //check the validation of the card number string
        if (valid.isOnlyNumbers(jTextField9.getText())==false){
            JOptionPane.showMessageDialog(null, "Sorry, Only numbers, please!!");
        }
    }//GEN-LAST:event_jTextField9KeyReleased
    private void jTable2MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable2MouseReleased
        //when the user selects a card number from the table, get the selected row
        DefaultTableModel customerTBLModel= (DefaultTableModel)jTable2.getModel();
        int ccdChoice = jTable2.getSelectedRow();
        String creditcardno = customerTBLModel.getValueAt(ccdChoice, 0).toString();
        
        List<Customer> customerList = null;
        //get the customer from the database using the credit card number and create tmp customer
        Services stub = ClientUtils.provideRMI();
        if(stub!=null){
            try {
                customerList = stub.getCustomers(creditcardno);
            } catch (RemoteException ex) {
                Logger.getLogger(StepsJFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
        
            tmpCustomer = customerList.get(0);
            //enable the next button when finished
            nextBtn.setEnabled(true);
        }
    }//GEN-LAST:event_jTable2MouseReleased
    private void finishBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_finishBtnActionPerformed
        tmpBooking.setCustomer(tmpCustomer);
        Services stub = ClientUtils.provideRMI();
        if(stub!=null){
            try {
                //save the tmp booking to the database
                stub.insertNewBooking(tmpBooking);
                int bookingId = stub.getBookingId(tmpBooking);
                tmpBooking.setId(bookingId);
                tmpInvoice = new Invoice(tmpBooking,total);
                //save the invoice to the database
                stub.insertNewInvoice(tmpInvoice);
            
            JOptionPane.showMessageDialog(null, "Car Successfully Booked!");
            
            } catch (RemoteException ex) {
                Logger.getLogger(StepsJFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
            //open up a new invoice frame and populate it
            JFrameInvoice invoice = new JFrameInvoice();
            invoice.setVisible(true);
            invoice.fillInvoice(tmpInvoice);
            //go back to card and set the appearance of card1
            card1.setVisible(true);
        
            DefaultTableModel carTBLModel= (DefaultTableModel)jTable1.getModel();
            while(carTBLModel.getRowCount()>0){
                carTBLModel.removeRow(0);
            }
            jComboBox1.setSelectedIndex(0);
            toDate.setSelectedDate(null);
            fromDate.setSelectedDate(null);
            fromDate.setEnabled(false);      
            toDate.setEnabled(false);
            try{
                jComboBox2.setSelectedIndex(0);
            }catch(Exception ex){
                jComboBox2.setEnabled(false);
            }
        }
    }//GEN-LAST:event_finishBtnActionPerformed
    private void jComboBox2ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox2ItemStateChanged
        //get the dates from the date choosers and format them
        String selectedLocation = jComboBox1.getSelectedItem().toString();
        String selectedCategory = jComboBox2.getSelectedItem().toString();
        DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
	toDate.setDateFormat(formater);
        fromDate.setDateFormat(formater);
        Date startDate = Date.valueOf(fromDate.getText());
        Date endDate = Date.valueOf(toDate.getText());
        
        Services stub = ClientUtils.provideRMI();
        if(stub!=null){
            try {
                //get the list of available cars for the selected options from the database
                availableCars = stub.getCarsByLocationCategory(selectedLocation,selectedCategory,startDate,endDate);
            } catch (Exception ex) {
                Logger.getLogger(StepsJFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
            if(availableCars.size()>0){
                //fill the result received from the db into the JTable
                populateCarTable(availableCars);
            }
        }
    }//GEN-LAST:event_jComboBox2ItemStateChanged
    private void toDateOnSelectionChange(datechooser.events.SelectionChangedEvent evt) {//GEN-FIRST:event_toDateOnSelectionChange
        //enable combo box when date is selected...validation from here on
        jComboBox2.setEnabled(true);
    }//GEN-LAST:event_toDateOnSelectionChange
    private void lnameTFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_lnameTFKeyReleased
        if (valid.isValidString(fnameTF.getText())==false){
            JOptionPane.showMessageDialog(null, "The First Name is invalid, please check it!!");
        }
    }//GEN-LAST:event_lnameTFKeyReleased
    private void emailTFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_emailTFKeyReleased

        if (valid.isValidString(lnameTF.getText())==false){
            JOptionPane.showMessageDialog(null, "The Last Name is invalid, please check it!!");
        } 

    }//GEN-LAST:event_emailTFKeyReleased
    private void licenseTFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_licenseTFKeyReleased
        if (valid.isValidEmailAddress(emailTF.getText())==false){
            JOptionPane.showMessageDialog(null, "The Email is invalid, please check it!!");
        } 
    }//GEN-LAST:event_licenseTFKeyReleased
    private void licExpDayMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_licExpDayMouseClicked

        if (valid.isValidLicense(licenseTF.getText())==false){
            JOptionPane.showMessageDialog(null, "Invalid License. The License needs to have minimum of 10 characters, please check it!!");
        }
        

    }//GEN-LAST:event_licExpDayMouseClicked
    private void licExpYearItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_licExpYearItemStateChanged
        
       if (licExpDay.getSelectedIndex()==0){
            JOptionPane.showMessageDialog(null, "Please select the Day that your License will expire...");
        }else if (licExpMonth.getSelectedIndex()==0){
            JOptionPane.showMessageDialog(null, "Please select the Month that your License will expire...");
        }
        if (licExpDay.getSelectedIndex()!=0 && licExpMonth.getSelectedIndex()!=0 && licExpYear.getSelectedIndex()!=0
){
            jCheckBox2.setEnabled(true);
            nextBtn.setEnabled(true);
        }
    }//GEN-LAST:event_licExpYearItemStateChanged
    private void jComboBox1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox1ItemStateChanged
        fromDate.setEnabled(true);
    }//GEN-LAST:event_jComboBox1ItemStateChanged
    private void fromDateOnSelectionChange(datechooser.events.SelectionChangedEvent evt) {//GEN-FIRST:event_fromDateOnSelectionChange
        toDate.setEnabled(true);
    }//GEN-LAST:event_fromDateOnSelectionChange

    private void expYearMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_expYearMouseClicked
        if (typeOfCard.getSelectedIndex()==0){
             JOptionPane.showMessageDialog(null, "Please select type of Credit Card!!");
             expYear.setSelectedIndex(0);
        }else if (valid.isValidCreditCard(cardNo.getText())==false){
            JOptionPane.showMessageDialog(null, "Invalid Credit Card - Max. 16 Digits!!");
             expYear.setSelectedIndex(0);
        }else if(valid.isValidCodeCreditCard(csvNo.getText())==false){
            JOptionPane.showMessageDialog(null, "Invalid CSV Code - Max. 3 Digits!!");
             expYear.setSelectedIndex(0);
        }else if(valid.isValidFullName(cardName.getText())==false){
            JOptionPane.showMessageDialog(null, "Invalid Name on the Card - Please check it!!");
             expYear.setSelectedIndex(0);
        }else if(expMonth.getSelectedIndex()==0){
            JOptionPane.showMessageDialog(null, "Please select the Month of the expiration of your Credit Card!!");
             expYear.setSelectedIndex(0);
        }else{
            nextBtn.setEnabled(true);
        }
    }//GEN-LAST:event_expYearMouseClicked
    /* Code to populate the table of cars with the list of cars returned from the server.
     * carTBLModel hold the data which is displayed by the JTable object.
     */
    private void populateCarTable(List<Car> cars){
        DefaultTableModel carTBLModel= (DefaultTableModel)jTable1.getModel();
        while(carTBLModel.getRowCount()>0){
            carTBLModel.removeRow(0);
        }
        for(int i=0;i<cars.size();i++){
            Car car = cars.get(i);
            carTBLModel.addRow(new Object[]{car.getReg_no(),car.getCategory().getCategory(),car.getLocation(),car.getCategory().getDaily_rate()});
        }
    }
    Validator valid = new Validator();
    static double daily_rate;
    static double total;
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton backBtn;
    private javax.swing.JButton cancelBtn;
    private javax.swing.JPanel card1;
    private javax.swing.JPanel card2;
    private javax.swing.JPanel card3;
    private javax.swing.JPanel card4;
    private javax.swing.JTextField cardName;
    private javax.swing.JTextField cardNo;
    private javax.swing.JTextField csvNo;
    private javax.swing.JTextField emailTF;
    private javax.swing.JComboBox expMonth;
    private javax.swing.JComboBox expYear;
    private javax.swing.JButton finishBtn;
    private javax.swing.JTextField fnameTF;
    private datechooser.beans.DateChooserCombo fromDate;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel100;
    private javax.swing.JLabel jLabel101;
    private javax.swing.JLabel jLabel102;
    private javax.swing.JLabel jLabel103;
    private javax.swing.JLabel jLabel104;
    private javax.swing.JLabel jLabel105;
    private javax.swing.JLabel jLabel106;
    private javax.swing.JLabel jLabel107;
    private javax.swing.JLabel jLabel108;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JLabel jLabel85;
    private javax.swing.JLabel jLabel86;
    private javax.swing.JLabel jLabel87;
    private javax.swing.JLabel jLabel88;
    private javax.swing.JLabel jLabel89;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabel90;
    private javax.swing.JLabel jLabel91;
    private javax.swing.JLabel jLabel92;
    private javax.swing.JLabel jLabel93;
    private javax.swing.JLabel jLabel94;
    private javax.swing.JLabel jLabel95;
    private javax.swing.JLabel jLabel96;
    private javax.swing.JLabel jLabel97;
    private javax.swing.JLabel jLabel98;
    private javax.swing.JLabel jLabel99;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JComboBox licExpDay;
    private javax.swing.JComboBox licExpMonth;
    private javax.swing.JComboBox licExpYear;
    private javax.swing.JTextField licenseTF;
    private javax.swing.JTextField lnameTF;
    private javax.swing.JPanel mainCard;
    private javax.swing.JCheckBox newCustomerCheck;
    private javax.swing.JButton nextBtn;
    private datechooser.beans.DateChooserCombo toDate;
    private javax.swing.JComboBox typeOfCard;
    // End of variables declaration//GEN-END:variables
}
